{% extends "wiki/base.html" %}
{% load wiki_tags i18n sekizai_tags static %}


{% block wiki_pagetitle %}{% trans "Add new article" %}{% endblock %}

{% block wiki_contents %}
    {% addtoblock "css" %}
        <link rel="stylesheet" href="/static/plugins/editor/css/editormd.min.css">
    {% endaddtoblock %}

    {% addtoblock "js" %}
        <script src="/static/plugins/editor/editormd.min.js"></script>
        <script>
            $("textarea.editormd").parent().attr({'id': 'editor'});
            editormd("editor", {
                width: "100%",
                height: "600px",
                codeFold: true,
                emoji: false,
                sequenceDiagram: true,
                taskList: true,
                flowChart: true,
                path: "/static/plugins/editor/lib/"
            });
        </script>
    {% endaddtoblock %}

    {% include "wiki/includes/editormedia.html" %}
    <h1 class="page-header">{% trans "Add new article" %}</h1>

    <form method="POST" class="form-horizontal">
        {% wiki_form create_form %}
        <div class="form-group form-actions">
            <div class="col-lg-2"></div>
            <div class="col-lg-10">
                <a href="{% url 'wiki:get' path=parent_urlpath.path %}" class="btn btn-secondary">
                    <span class="fa fa-arrow-left"></span>
                    {% trans "Go back" %}
                </a>
                <button type="submit" name="save_changes" class="btn btn-primary">
                    <span class="fa fa-plus"></span>
                    {% trans "Create article" %}
                </button>
            </div>
        </div>
    </form>

{% endblock %}
